package com.heima.wemedia.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.heima.model.dtos.ResponseResult;
import com.heima.model.wemedia.pojos.WmChannel;
import com.heima.wemedia.mapper.WmChannelMapper;
import com.heima.wemedia.service.WmChannelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 张一恒
 * @version 1.0
 * @description:
 * @date 2023/1/11 22:46
 */
@Service
@Slf4j
public class WmChannelServiceImpl extends ServiceImpl<WmChannelMapper, WmChannel> implements WmChannelService {

    /**
     * @return com.heima.model.dtos.ResponseResult
     * @description 查询所有频道name
     * @author 31115
     * @date 2023/1/11 22:48
     */
    @Override
    public ResponseResult channels() {
        List<WmChannel> wmChannel = this.list();
        if (wmChannel != null){
            return ResponseResult.okResult(wmChannel);
        }
        log.debug("无自媒体频道任信息：{}",wmChannel);
        return null;
    }
}
